% Chakram is a subproject of Hexena - Haskell Executable Analyser
% License:			GPL-3
% Maintainer:		Montez Fitzpatrick
% Stability:		Experimental
% Portability:		GHC
% Module:			Hexena.Data.OptionalHeader

Optional Headers exist to provide information to the loader.  All image files have
an Optional Header.  It is optional in the sense that object files, for instance, do
not generally have this header.  Though it is not illegal for object files to have 
an Optional Header, currently it serves no purpose.

\begin{code}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module Hexena.Data.OptionalHeader
	(
	-- * Data Structures
	  OptionalHeader(..)
	) where

import Data.Label -- Needs 'fclabels' package
import Data.Word

import Hexena.Data.OptionalHeader.AMD64 (AMD64(..))
import Hexena.Data.OptionalHeader.X86 (X86(..))
import Hexena.Data.OptionalHeader.ROM (ROM(..))
import Hexena.Data.OptionalHeader.DataDirectory ( DataDirectory(..), DirectoryEntry(..)
												, DataEntry(..))

-- | OptionalHeader as defined in WinNT.h from 
--   lines (10979-11087)
data OptionalHeader = X86		-- ^ Magic := 0x10b
					| AMD64		-- ^ Magic := 0x20b
					| ROM		-- ^ Magic := 0x107
					deriving (Show, Eq, Ord)
\end{code}
